
package es.udc.emarketapp.emarket.model.shoppingFacade.vo;

import es.udc.emarketapp.emarket.model.orderDetails.vo.OrderDetailsVO;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;


public class OrderCartVO implements Serializable{

    private String nomEmpresa;
    private OrderDetailsVO orderDetails;
    private Collection<OrderLineCartVO> orderLines;

    public OrderCartVO(String nomEmpresa, OrderDetailsVO orderDetails,
            Collection<OrderLineCartVO> orderLines) {
        this.nomEmpresa = nomEmpresa;
        this.orderDetails = orderDetails;
        this.orderLines = orderLines;
    }

    public OrderCartVO(String nomEmpresa, OrderDetailsVO orderDetails) {
        this.nomEmpresa = nomEmpresa;
        this.orderDetails = orderDetails;
        this.orderLines = new ArrayList<OrderLineCartVO>();
    }

    public String getNomEmpresa() {
        return nomEmpresa;
    }

    public void setNomEmpresa(String nomEmpresa) {
        this.nomEmpresa = nomEmpresa;
    }

    public OrderDetailsVO getOrderDetails() {
        return orderDetails;
    }

    public void setOrderDetails(OrderDetailsVO orderDetails) {
        this.orderDetails = orderDetails;
    }

    public void addOrderLine(OrderLineCartVO orderLine){
    	this.orderLines.add(orderLine);
    }

    public void removeOrderLine(OrderLineCartVO orderLine){
    	this.orderLines.remove(orderLine);
    }

    public Double getTotalOrder(){
        
       return (this.orderDetails.getValor() + this.orderDetails.getGastosEnvio());
    }
    
    public Collection<OrderLineCartVO> getOrderLines() {
        return orderLines;
    }


    
}

